<!-- FOOTER CONTAINER -->
<div id="footer-container">
	<div class="container">
		<div class="col-left pull-left">
			<p><?php echo $this->arrSystem['title_footer'];?> - ĐC: <?php echo $this->arrSystem['address'];?></p>
			<ul class="list-info-contact">
				<li><span><i class="icon icon-phone"></i><?php echo $this->arrSystem['phone'];?></span></li>
				<li><span><i class="icon icon-fax"></i><?php echo $this->arrSystem['fax'];?></span></li>
				<li><a href="#"><i class="icon icon-mail"></i><?php echo $this->arrSystem['email'];?></a></li>
			</ul>
		</div>
		<div class="col-right pull-right text-right">
			<p>Copyright 2014 &copy; Phòng công chứng 03, All rights reserved</p>
			<p class="designby">Designed by <a href="http://kovo.vn">Kovo.vn</a></p>
		</div>
	</div>
</div>

<!-- POPUP THÔNG TIN ĐẶT HẸN -->
<div id="popup-info-meet" class="popup mfp-with-anim mfp-hide">
	<h2 class="title title-bd text-center"><span>Thông tin đặt hẹn</span></h2>
	<?php $form = $this->beginWidget('CActiveForm', array(
		'id'=>'schedule-form',
		//'enableAjaxValidation'=>true,
		'enableClientValidation'=>true,
		'focus'=>array($this->model,'title'),
		'action'=>PIUrl::createUrl('/home/schedule'),
		'htmlOptions'=>array('class'=>'form-horizontal'),
	)); ?>
		<div class="wrap-form-group">
			<?php echo $form->textField($this->model,'name',array('placeholder'=>'Họ tên', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textField($this->model,'email',array('placeholder'=>'Địa chỉ email', 'class'=>'form-control')); ?>
			
							
			<?php echo $form->textField($this->model,'title',array('placeholder'=>'Tiêu đề', 'class'=>'form-control')); ?>
			
			
			
			<?php echo $form->textField($this->model,'address',array('placeholder'=>'Địa chỉ', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textField($this->model,'phone',array('placeholder'=>'Số điện thoại', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textArea($this->model,'content',array('placeholder'=>'Nội dung', 'class'=>'form-control')); ?>
			
		</div>
		<p class="text-center">
			<button type="submit" class="btn-custom">Gửi</button>
		</p>
	<?php $this->endWidget(); ?>
</div>

<!-- POPUP GỬI THƯ GÓP Ý -->
<div id="popup-info-comment" class="popup mfp-with-anim mfp-hide">
	<h2 class="title title-bd text-center"><span>Gửi thư góp ý</span></h2>
	<?php $form = $this->beginWidget('CActiveForm', array(
		'id'=>'comment-form',
		//'enableAjaxValidation'=>true,
		'enableClientValidation'=>true,
		'focus'=>array($this->model,'title'),
		'action'=>PIUrl::createUrl('/home/comment'),
		'htmlOptions'=>array('class'=>'form-horizontal'),
	)); ?>
		<div class="wrap-form-group">
			<?php echo $form->textField($this->model,'name',array('placeholder'=>'Họ tên', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textField($this->model,'email',array('placeholder'=>'Địa chỉ email', 'class'=>'form-control')); ?>
			
							
			<?php echo $form->textField($this->model,'title',array('placeholder'=>'Tiêu đề', 'class'=>'form-control')); ?>
			
			
			
			<?php echo $form->textField($this->model,'address',array('placeholder'=>'Địa chỉ', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textField($this->model,'phone',array('placeholder'=>'Số điện thoại', 'class'=>'form-control')); ?>
			
			
			<?php echo $form->textArea($this->model,'content',array('placeholder'=>'Nội dung', 'class'=>'form-control')); ?>
			
		</div>
		<p class="text-center">
			<button type="submit" class="btn-custom">Gửi</button>
		</p>
	<?php $this->endWidget(); ?>
</div>

<!-- MENU RESPONSIVE -->
<div id="wd-menu-vertical">
	<ul>
		<li class="mm-selected"><a href="<?php echo PIUrl::createUrl('/home/');?>" class="active"><?php echo translate('Trang chủ');?></a></li>
		<li><a href="<?php echo PIUrl::createUrl('/home/information');?>"><?php echo translate('Giới thiệu');?></a></li>
		<li><a href="<?php echo PIUrl::createUrl('/home/procedure');?>"><?php echo translate('Thủ tục hành chính');?></a></li>
		<li><a href="<?php echo PIUrl::createUrl('/home/fee');?>"><?php echo translate('Lệ phí');?></a></li>
		<li><a href="<?php echo PIUrl::createUrl('/home/document');?>"><?php echo translate('Biểu mẫu');?> <i class="icon icon-arrow"></i></a>
			<?php if(!empty($this->arrCategoriesDocuments)){ ?>
				<ul>
					<?php foreach($this->arrCategoriesDocuments as $row){ ?>
						<li><a href="<?php echo PIUrl::createUrl('/home/document#'.$row['id']);?>"><?php echo $row['name']; ?></a></li>
					<?php } ?>
				</ul>
			<?php } ?>
		</li>
		<li><a href="<?php echo PIUrl::createUrl('/home/documentLaw');?>"><?php echo translate('Văn bản pháp luật');?></a></li>
		<li><a href="<?php echo PIUrl::createUrl('/home/contact');?>"><?php echo translate('Liên hệ');?></a></li>
	</ul>
</div>

<!-- Script -->
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/imgLiquid-min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/owl.carousel.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery.magnific-popup.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/gmap3.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery.mmenu.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery.BlackAndWhite.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/js/common.js"></script>
<script>

function ValidateEmail(mail)   
{  
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail))  
  {  
    return true;  
  }  else return false;
}  

	$(document).ready(function(){
		
		$("#schedule-form").submit(function(){
			var error =  true; errorEmail = true;  var i=0;
			$("#schedule-form .form-control").each(function(){
				i++;
				if(i == 2){
					if(ValidateEmail($(this).val()) == false){ errorEmail = false;
						$(this).attr("class", "error form-control");
					}
				}else{
					if($(this).val() == ""){ error = false;
						$(this).attr("class", "error form-control");
					}
				}
				
			});
			if(error == false){
				alert("Bạn cần nhập đầy đủ thông tin"); return false;
			}else{
				if(errorEmail == false){
					$('#schedule-form #CommentsSchedules_email').css('color','red').focus();
					alert("Email không hợp lệ");
					return false;
				}
			}
			
			return true;
		});	
		
		$("#comment-form").submit(function(){
			var error =  true; errorEmail = true;  var i=0;
			$("#comment-form .form-control").each(function(){
				i++;
				if(i == 2){
					if(ValidateEmail($(this).val()) == false){ errorEmail = false;
						$(this).attr("class", "error form-control");
					}
				}else{
					if($(this).val() == ""){ error = false;
						$(this).attr("class", "error form-control");
					}
				}
				
			});
			if(error == false){
				alert("Bạn cần nhập đầy đủ thông tin"); return false;
			}else{
				if(errorEmail == false){
					$('#comment-form #CommentsSchedules_email').css('color','red').focus();
					alert("Email không hợp lệ");
					return false;
				}
			}
		
			return true;
		});
			
		var successMsg = '<?php echo (yii::app()->user->hasFlash('success')) ? yii::app()->user->getFlash('success') : ''; ?>';
		
		if(successMsg!=""){
			$().toastmessage('showToast', {
				text     : successMsg,
				sticky   : false,
				position : 'top-right',
				type     : 'success',
				close    : function () {console.log("toast is closed ...");}
			});
		}
	})
</script>
<style>
#schedule-form .error::-webkit-input-placeholder{color:red;}
#comment-form .error::-webkit-input-placeholder{color:red;}
</style>
</body>
</html>